package ch11;

import java.util.TreeSet;

class _15_TreeSetEx2 {
	public static void main(String[] args) {
		TreeSet<Integer> set = new TreeSet<Integer>();
		int[] score = { 85, 95, 50, 35, 45, 65, 10, 100 };

		for (int i = 0; i < score.length; i++) set.add(score[i]);

		System.out.println("less than 50:" + set.headSet(50)); // less than 50:[10, 35, 45]
		System.out.println("greater than or equal to 50:" + set.tailSet(50));
		// greater than or equal to 50:[50, 65, 85, 95, 100]
	}
}